package MOLE.Bill;

import MOLE.*;

/** 
 Comm ��ժҪ˵����
 ��ע��
*/
public class Comm
{
	public Comm()
	{
		//
		// TODO: �ڴ˴���ӹ��캯���߼�
		//
	}


	public static String _GetBillTypeName(int playid)
	{
//C# TO JAVA CONVERTER TODO TASK: There is no preprocessor in Java:
			///#region
		String s = BillResx.BillType;
		String[] ss = s.split("[,]", -1);
		String r = "";
		for (int i = 0;i < ss.length;i++)
		{
			if (ss[i].trim().equals(String.valueOf(playid)))
			{
				return ss[i - 1];
			}

		}
		return "";
//C# TO JAVA CONVERTER TODO TASK: There is no preprocessor in Java:
			///#endregion
	}


	//����ע ���㷨 (������ֵ,��׼Ͷע) ___��ע��
	public static int GetMultiZhuBaseSingleselectByPlayid(int playid, String number)
	{
//C# TO JAVA CONVERTER TODO TASK: There is no preprocessor in Java:
			///#region
		int zhu = 0;
		if (number.split("[@]", -1).getLength() > 1) //��ע
		{
			String[] s = number.split("[@]", -1);
			for (int i = 0;i < s.length;i++)
			{
				zhu = zhu + GetZhuBaseSingleselectByPlayid(playid, s[i].trim());
			}
			return zhu;

		}
		else
		{
			return GetZhuBaseSingleselectByPlayid(playid, number);
		}
//C# TO JAVA CONVERTER TODO TASK: There is no preprocessor in Java:
			///#endregion
	}



	//����ע ���㷨 (������ֵ,��׼Ͷע) ___��ע
	public static int GetZhuBaseSingleselectByPlayid(int playid, String number)
	{
//C# TO JAVA CONVERTER TODO TASK: There is no preprocessor in Java:
			 ///#region
		//��ֵͶע
		if (BillResx.Playid_HeazhThreeStar == playid)
		{
			  return GetHezhiZhushu(Integer.parseInt(number), 3);
		}
		if (BillResx.Playid_HeazhTwoStar == playid)
		{
			return GetHezhiZhushu(Integer.parseInt(number), 2);
		}

		//��׼Ͷע
		return GetOther(number);
//C# TO JAVA CONVERTER TODO TASK: There is no preprocessor in Java:
			///#endregion
	}





	//��ֵע���㷨_ ��ע
	public static int GetHezhiZhushu(int hezhi, int xinji)
	{
//C# TO JAVA CONVERTER TODO TASK: There is no preprocessor in Java:
			///#region
		String s = "";
		int num = hezhi;
		int i,j,k,n = 0;
		for (i = 0;i < 10;i++)
		{
			for (j = 0;j < 10;j++)
			{
				if (xinji == 2)
				{
					if (i + j == num)
					{
						s = s + " " + i + j;
						n++;
					}
				}
				else //xinji==3
				{
					for (k = 0;k < 10;k++)
					{
						if (i + j + k == num)
						{
							s = s + " " + i + j + k;
							n++;
						}
					}
				}
			}
		}

		return n;
//C# TO JAVA CONVERTER TODO TASK: There is no preprocessor in Java:
			///#endregion
	}

	//��׼�㷨_ ��ע
	public static int GetOther(String number)
	{
//C# TO JAVA CONVERTER TODO TASK: There is no preprocessor in Java:
			///#region
		String s = number;
		int price = 1;
		for (String x : s.split("[|]", -1))
		{
			price = price * x.length();
		}

		return price;
//C# TO JAVA CONVERTER TODO TASK: There is no preprocessor in Java:
			///#endregion
	}


//C# TO JAVA CONVERTER TODO TASK: There is no preprocessor in Java:
		///#region
	public static int GetZhuBaseSingleselect(String number, int teuzhuType, int star)
	{


		if (teuzhuType == BillResx.TeuzhuType_SingleSelect)
		{
			return 0;
		}
		if (teuzhuType == BillResx.TeuzhuType_MultiSelect)
		{
			return 0;
		}

		if (teuzhuType == BillResx.TeuzhuType_Heazh)
		{
			return GetHezhiZhushu(Integer.parseInt(number), star);
		}


		return 0;


	}
//C# TO JAVA CONVERTER TODO TASK: There is no preprocessor in Java:
		///#endregion



}